<!--页面主要内容-->
<style>
    .warning.form-control:focus {
        border-color: red;
        -webkit-box-shadow: inset 0 1px 1px rgb(0 0 0 / 8%), 0 0 8px rgba(253, 0, 0, 0.6);
        box-shadow: inset 0 1px 1px rgb(0 0 0 / 8%), 0 0 8px rgba(255, 0, 60, 0.6);
    }
</style>
<main class="lyear-layout-content">

    <div class="container-fluid">

        <div class="row">
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-body">

                        <form method="post" class="site-form">
                            <div class="form-group">
                                <label for="username">用户名</label>
                                <input type="text" class="form-control" name="username" id="username" placeholder="输入用户名">
                            </div>

                            <div class="form-group">
                                <label for="nickname">昵称</label>
                                <input type="text" class="form-control" name="nickname" id="nickname" placeholder="输入昵称">
                            </div>


                            <div class="form-group">
                                <label for="new-password">新密码</label>
                                <input type="password" class="form-control" name="newpwd" id="new-password" placeholder="输入新的密码">
                            </div>

                            <div class="form-group">
                                <label for="confirm-password">确认新密码</label>
                                <input type="password" class="form-control" name="confirmpwd" id="confirm-password" placeholder="请输入确认新密码">
                            </div>

                            <div class="form-group">
                                <label for="state">状态</label>
                                <div class="clearfix">
                                    <label class="lyear-radio radio-inline radio-primary">
                      <input type="radio" name="state"  value="0"><span>禁用</span>
                    </label>
                                    <label class="lyear-radio radio-inline radio-primary">
                      <input type="radio" name="state" value="1"  checked><span>启用</span>
                    </label>
                                </div>
                            </div>
                            <button type="submit" id="btn" class="btn btn-primary">确认修改</button>
                            <button type="button" class="btn btn-default" onclick="javascript:history.back(-1);return false;">返 回</button>
                        </form>

                    </div>
                </div>
            </div>

        </div>

    </div>

</main>
<!--End 页面主要内容-->
<script src="/static/admin/js/bootstrap-notify.min.js"></script>
<script type="text/javascript" src="/static/admin/js/lightyear.js"></script>

<script>
    $('#username').change(function() {
        var val = $(this).val();
        $.ajax({
            type: 'post',
            url: `{:url('admin/admin/add')}`,
            data: {
                username: val
            },
            dataType: 'json',
            success: function(res) {
                // console.log(res);
                if (res.code == 0) {
                    $('#username').addClass('warning');
                    lightyear.notify(res.msg, 'warning', 3000);
                }
            }
        })
    });
</script>